package com.atguigu06.polymorphism.ex1;

public class GeometricTest {
    public static void main(String[] args) {
        GeometricTest geometricTest=new GeometricTest();
GeometricObject geometricObject1=new Circle("black",4,5);
GeometricObject geometricObject2=new MyRectangle("red",7,6,8);
Circle c1=new Circle("write",4,7);
        System.out.println(geometricObject1.getArea());
        System.out.println(geometricObject2.getArea());
        System.out.println(geometricTest.equal(geometricObject1, geometricObject2));
        System.out.println(geometricTest.displayArea(c1));

    }
    public boolean equal(GeometricObject g1,GeometricObject g2){
        if(g1.getArea()==g2.getArea()){
            return true;
        }else{
            return false;
        }
    }
    public double displayArea(GeometricObject geometricObject){
        return geometricObject.getArea();
    }
}
